<?php

namespace D3hdv\Diablo3Bundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class D3ObjetModeleType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nom')
            ->add('niveau')
           //->add('file','text', array('required' => true) )       
	    ->add('file')   
            ->add('Type','entity', array(
	            		'class' => 'D3hdvDiablo3Bundle:D3ObjetType',
	            		'property' => 'objetType'))
            ->add('Classe','entity', array(
	            		'class' => 'D3hdvDiablo3Bundle:D3ObjetClasse',
	            		'property' => 'objetClasse',
			       ))
	    ->add('spe')
            ->add('Rarete','entity', array(
	            		'class' => 'D3hdvDiablo3Bundle:D3ObjetRarete',
	            		'property' => 'objetRarete'))
            ->add('Caracteristiques','collection',array('type' => new D3ObjetCaracValeurType(),
						'allow_add'    => true,
                                              'allow_delete' => true))
	    
        ;

    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'D3hdv\Diablo3Bundle\Entity\D3ObjetModele'
        ));
    }

    public function getName()
    {
        return 'd3hdv_diablo3bundle_d3objetmodeletype';
    }
}
